package com.sunqianhu.design_patterns_23.behavioral.responsibility;

public class Ceo extends Approver{

    @Override
    public void processRequest(LeaveRequest request) {
        if (request.getDays() > 7) {
            System.out.println("ceo approves " + request.getName() + "'s leave for " + request.getDays() + " days.");
        } else if (successor != null) {
            successor.processRequest(request); // 将请求传递给后继者
        }
    }
}
